Crystal Report Wizard

The Crystal Report Wizard developer component is used in applications created in Microsoft Visual Basic. The Wizard lets end-users create a new report at runtime; they can then save, view, and/or edit the report.

The Crystal Report Wizard can also be used as a starting point for a custom report Wizard, allowing the programmer to set defaults for report creation.


Overview

Developers using the Crystal Report Wizard determine what database to use, what tables to make available to end-users, and how tables should be linked (if multiple tables are to be used). End-users create a report to their specifications once the Wizard has been called from the Visual Basic application. The Wizard itself does not have any calls; programmers use RDC calls and open the Wizard through Visual Basic code.

RDC calls can be used to populate fields in a report and then to call the Crystal Report Wizard. Use RDC calls to add additional report objects such text objects, unbound fields, graphs, and formulas before calling the Wizard.


Using the Crystal Report Wizard

The two procedures in this section offer general guidelines for calling the Crystal Report Wizard from a Visual Basic application and creating a report using the Crystal Report Wizard.


To call the Crystal Report Wizard from a Visual Basic application

This procedure is an overview of the sample code found at \\Program Files\Seagate Software\Crystal Reports\Samples\En\Code\Visual Basic\Report Wizard. Use this procedure in connection with the sample code.

1	Create a blank report.

2	Add a data source to the report.

The Crystal Report Wizard will include any data source that has been added to the report.

Note: If you are adding multiple tables to a report and you want the tables to be linked, you must add the links before calling the Crystal Report Wizard. There is currently no linking done in the Wizard.

3	Add links between two or more tables (if you are using multiple tables).

4	Provide the Wizard with a starting report definition. If you give it a report that includes other report objects, such as fields or text objects, the Wizard will incorporate these pre-existing objects into the final report.

5	Run (compile) the application in Visual Basic.

The Crystal Report Wizard appears.


To create a report using the Crystal Report Wizard

1	Add the database fields you want to appear in your report to the Fields to Display list.

The arrow buttons on this dialog box enable you to move fields from one list to the other. Single arrows move only the selected field; double arrows move all fields at the same time.

2	Click Next to choose fields to group on.

3	Add the database fields you want to group on to the Group By box.

When a group field is selected, you can choose a sorting order from the Sort Order box.

4	Click Next to choose fields to summarize on.

5	Add the database fields you want to total on to the Summarized Fields list.

Summarized fields apply to the group specified in the For the Group box. You can use the same fields in each of several different groups.

When a summary field is selected, you can choose a summary type for it and add a grand total.

6	Click Next to sort groups on their summarized totals.

You can select Sort All Groups, or you can specify a Top or Bottom N.

7	Click Next to create a record selection for your report.

8	Add the database fields you’ll use to filter your report to the Filtered Fields list.

Define your record selection by selecting from the box of limiting operators and entering the appropriate field value.

9	Click Next to select a report style.

10	Click Next to enter a title and saving location for your report.

11	Choose a method for previewing your report.

There are four options:

•	Preview (read only)

•	Edit with the Report Designer

•	Analyze with Crystal Analysis

•	View Later.

The Preview option opens the report in the ActiveX viewer. You can view, print, and refresh the report in the viewer.

The Edit and Analyze options open the report in the appropriate program. You can view, print, refresh, and modify the report while using all the capabilities of Crystal Reports or Crystal Analysis.

The View Later option saves the report with the name you gave it to the directory you specified.

Now that your report has been created, you can use it and modify it as you would any other report in Crystal Reports.